import Mock from 'mockjs'
import { param2Obj } from '@/utils'

export default {
  getEnums: () => ({
    data: {
      // platformOptions: ["phone", "userId", "customerId", "realName"],
      // envOptions: ["dev", "test", "pre", "product"],
      userInfoTypeOptions: ['phone', 'userId', 'customerId', 'realName'],
      clientNameOptions: ['xxx-client', 'xxxService', 'customerId', 'realName'],
      serviceCategoryOptions: ['xxx-client', 'xxxService', 'customerId', 'realName'],
      serviceNameOptions: ['xxx-client', 'xxxService', 'customerId', 'realName'],
      methodNameOptions: ['xxx-client', 'xxxService', 'customerId', 'realName'],
      rpcTypeOptions: ['ice', 'ws', 'http', 'db', 'redis', 'mq', 'task', 'dubbo'],
      resultOptions: ['OK', 'ERROR']
    },
    code: '0000',
    msg: '成功'
  }),
  queryTraceInfo: (config) => ({
    data: {
      id: '1',
      event: '1',
      runTime: 500,
      env: '无',
      children: [{
        id: '1.1',
        event: '1.1',
        runTime: 300,
        env: 'xxxxx'
      },
      {
        id: '1.2',
        event: '1.2',
        runTime: 200,
        env: '无',
        children: [{
          id: '1.2.1',
          event: '事件4',
          runTime: 20,
          env: '无'
        },
        {
          id: '1.2.2',
          event: '事件5',
          runTime: 125,
          env: '无'
        },
        {
          id: '1.2.3',
          runTime: 55,
          env: '无',
          children: [{
            id: '1.2.3.1',
            event: '事件7',
            runTime: 40,
            env: '无',
            children: [{
              id: '1.2.3.1.1',
              event: '事件71',
              runTime: 10,
              env: 'xx'
            },
            {
              id: '1.2.3.1.2',
              event: '事件72',
              runTime: 5,
              env: 'xx'
            },
            {
              id: '1.2.3.1.3',
              event: '事件73',
              runTime: 25,
              env: 'xx'
            }
            ]
          },
          {
            id: '1.2.3.2',
            event: '事件8',
            runTime: 15,
            env: '无'
          }
          ]
        }
        ]
      }
      ]
    },
    code: '0000',
    msg: '成功'
  })

}
